package cn.edu.scau.cmi.hekaimin.multiton;

import java.util.ArrayList;

public class Marshal {
	private static int maxNumOfMarshal = 10;
	
	private static ArrayList<Marshal> marshals = new ArrayList<>(maxNumOfMarshal);
	private static ArrayList<String>  names = new ArrayList<>(maxNumOfMarshal);
	
	private Marshal(String name) {
		names.add(name);
	}
	public static ArrayList<Marshal> addInstance(String name){
		if(marshals.size() < 10) {
			marshals.add(new Marshal(name));
		}
		return marshals;
	}
	public static ArrayList<String> getNames() {
		return names;
	}
}
